﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace graphicsdemo
{
    public class Circle:Graphics
    {
        private double r;

        public Circle(double r)
        {
            R = r;
        }

        public double R { get => r; set => r = value; }
        public override bool IfEffect()
        {
            if(R <= 0)
                return false;
            else
                return true;
        }
        public override double GetArea()
        {
            if (IfEffect())
                return Math.PI * R * R;
            else
                return 0;
        }
        public override void Show()
        {
            Console.WriteLine("这个形状是圆形  ，面积为" + GetArea());
        }
    }
}
